Enterprise Objects Framework Release 1.1 Copyright ã1995 by NeXT Computer, Inc.  All Rights Reserved.

EOPopUpAssociation 

Inherits From:	EOAssociation : NSObject

Conforms To:	EOAssociationNotification (EOAssociation)

Declared In:	eointerface/EOPopUpAssociation.h

Class Description

An EOPopUpAssociation uses a popup list to display the value of an enterprise object for its key, and notifies its controller when the user chooses a new item in the popup list. To set up a popup association, you have to create the popup list in Interface Builder and manually populate it with items representing the possible values for the association's key. You then form the association from the controller to the popup list's button.

When the association is notified of a change by its controller, it gets the value of the first selected enterprise object and looks for a matching string value in the popup list's items. If it finds an item equal to the enterprise object's value, it has the popup list select that item. If it doesn't find an item with the value, it temporarily creates an extra item with that value, adds it to the bottom of the popup list, and has the popup list select it. The next time the association is notified of a change in selection or contents by its controller, it removes the temporary item from the popup list. By temporarily adding items to its popup list the association guarantees that the right thing is displayed even for a value outside the set of ªlegalº values.

When the user selects an item in the popup list, the association simply sends an associationDidEdit: message to its controller. An EOPopUpAssociation's value is the string value of the selected item in the popup list, so this item will be used as the new value for the enterprise object. Note that if a temporary item was added to the popup list, it's immediately removed if the user chooses a different one.

Although the interface of any association contains only a few methods, various implementations are often highly dependent on one another and on the way the destination objects act. Because of this, if you need to create an association class for a custom subclass of PopUpList, you should create it as an immediate subclass of EOAssociation.

Instance Variables

None declared in this class.

Instance Methods

None declared in this class.